home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Palettes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  4.3 KB  |  149 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Tuesday, September 17, 1991 at 2:56 PM
  5.  Palettes.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1987-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __PALETTES__
  16. #define __PALETTES__
  17.  
  18. #ifndef __QUICKDRAW__
  19. #include <Quickdraw.h>
  20. #endif
  21.  
  22. #ifndef __WINDOWS__
  23. #include <Windows.h>
  24. #endif
  25.  
  26.  
  27. enum {
  28.  
  29.  pmCourteous = 0,            /*Record use of color on each device touched.*/
  30.  pmTolerant = 0x0002,        /*render ciRGB if ciTolerance is exceeded by best match.*/
  31.  pmAnimated = 0x0004,        /*reserve an index on each device touched and render ciRGB.*/
  32.  pmExplicit = 0x0008,        /*no reserve, no render, no record; stuff index into port.*/
  33.  
  34.  pmWhite = 0x0010,
  35.  pmBlack = 0x0020,
  36.  
  37.  pmInhibitG2 = 0x0100,
  38.  pmInhibitC2 = 0x0200,
  39.  pmInhibitG4 = 0x0400,
  40.  pmInhibitC4 = 0x0800,
  41.  pmInhibitG8 = 0x1000,
  42.  pmInhibitC8 = 0x2000,
  43.  
  44.  
  45. /* NSetPalette Update Constants */
  46.  pmNoUpdates = 0x8000,        /*no updates*/
  47.  pmBkUpdates = 0xA000,        /*background updates only*/
  48.  pmFgUpdates = 0xC000,        /*foreground updates only*/
  49.  pmAllUpdates = 0xE000        /*all updates*/
  50. };
  51.  
  52. struct ColorInfo {
  53.  RGBColor ciRGB;            /*true RGB values*/
  54.  short ciUsage;                /*color usage*/
  55.  short ciTolerance;            /*tolerance value*/
  56.  short ciDataFields[3];        /*private fields*/
  57. };
  58.  
  59. typedef struct ColorInfo ColorInfo;
  60.  
  61. struct Palette {
  62.  short pmEntries;            /*entries in pmTable*/
  63.  short pmDataFields[7];        /*private fields*/
  64.  ColorInfo pmInfo[1];
  65. };
  66.  
  67. typedef struct Palette Palette;
  68. typedef Palette *PalettePtr, **PaletteHandle;
  69.  
  70.  
  71. #ifdef __cplusplus
  72. extern "C" {
  73. #endif
  74. pascal void InitPalettes(void)
  75.  = 0xAA90; 
  76. pascal PaletteHandle NewPalette(short entries,CTabHandle srcColors,short srcUsage,
  77.  short srcTolerance)
  78.  = 0xAA91; 
  79. pascal PaletteHandle GetNewPalette(short PaletteID)
  80.  = 0xAA92; 
  81. pascal void DisposePalette(PaletteHandle srcPalette)
  82.  = 0xAA93; 
  83. pascal void ActivatePalette(WindowPtr srcWindow)
  84.  = 0xAA94; 
  85. pascal void SetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,Boolean cUpdates)
  86.  = 0xAA95; 
  87. pascal void NSetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,short nCUpdates)
  88.  = 0xAA95; 
  89. pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  90.  = 0xAA96; 
  91. pascal void CopyPalette(PaletteHandle srcPalette,PaletteHandle dstPalette,
  92.  short srcEntry,short dstEntry,short dstLength)
  93.  = 0xAAA1; 
  94. pascal void PmForeColor(short dstEntry)
  95.  = 0xAA97; 
  96. pascal void PmBackColor(short dstEntry)
  97.  = 0xAA98; 
  98. pascal void AnimateEntry(WindowPtr dstWindow,short dstEntry,const RGBColor *srcRGB)
  99.  = 0xAA99; 
  100. pascal void AnimatePalette(WindowPtr dstWindow,CTabHandle srcCTab,short srcIndex,
  101.  short dstEntry,short dstLength)
  102.  = 0xAA9A; 
  103. pascal void GetEntryColor(PaletteHandle srcPalette,short srcEntry,RGBColor *dstRGB)
  104.  = 0xAA9B; 
  105. pascal void SetEntryColor(PaletteHandle dstPalette,short dstEntry,const RGBColor *srcRGB)
  106.  = 0xAA9C; 
  107. pascal void GetEntryUsage(PaletteHandle srcPalette,short srcEntry,short *dstUsage,
  108.  short *dstTolerance)
  109.  = 0xAA9D; 
  110. pascal void SetEntryUsage(PaletteHandle dstPalette,short dstEntry,short srcUsage,
  111.  short srcTolerance)
  112.  = 0xAA9E; 
  113. pascal void CTab2Palette(CTabHandle srcCTab,PaletteHandle dstPalette,short srcUsage,
  114.  short srcTolerance)
  115.  = 0xAA9F; 
  116. pascal void Palette2CTab(PaletteHandle srcPalette,CTabHandle dstCTab)
  117.  = 0xAAA0; 
  118. pascal long Entry2Index(short entry)
  119.  = {0x7000,0xAAA2}; 
  120. pascal void RestoreDeviceClut(GDHandle gd)
  121.  = {0x7002,0xAAA2}; 
  122. pascal void ResizePalette(PaletteHandle p,short size)
  123.  = {0x7003,0xAAA2}; 
  124. pascal void SaveFore(ColorSpec *c)
  125.  = {0x303C,0x040D,0xAAA2}; 
  126. pascal void SaveBack(ColorSpec *c)
  127.  = {0x303C,0x040E,0xAAA2}; 
  128. pascal void RestoreFore(const ColorSpec *c)
  129.  = {0x303C,0x040F,0xAAA2}; 
  130. pascal void RestoreBack(const ColorSpec *c)
  131.  = {0x303C,0x0410,0xAAA2}; 
  132. pascal OSErr SetDepth(GDHandle gd,short depth,short whichFlags,short flags)
  133.  = {0x303C,0x0A13,0xAAA2}; 
  134. pascal short HasDepth(GDHandle gd,short depth,short whichFlags,short flags)
  135.  = {0x303C,0x0A14,0xAAA2}; 
  136. pascal short PMgrVersion(void)
  137.  = {0x7015,0xAAA2}; 
  138. pascal void SetPaletteUpdates(PaletteHandle p,short updates)
  139.  = {0x303C,0x0616,0xAAA2}; 
  140. pascal short GetPaletteUpdates(PaletteHandle p)
  141.  = {0x303C,0x0417,0xAAA2}; 
  142. pascal Boolean GetGray(GDHandle device,const RGBColor *backGround,RGBColor *foreGround)
  143.  = {0x303C,0x0C19,0xAAA2}; 
  144. #ifdef __cplusplus
  145. }
  146. #endif
  147.  
  148. #endif
  149.